package com.wlc.conn;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBConnection {
	public static void main(String[] args) {
		String url="jdbc:oracle:thin:@localhost:1521:orcl";
		Connection conn=null;
		try {
			Class.forName("oracle.jdbc.driver.OracleDriver");
			conn=DriverManager.getConnection(url,"scott","Oracle11g");
			System.out.println("database connection success!");
		} catch (ClassNotFoundException | SQLException e) {
			e.printStackTrace();
			System.out.println("Class not found,error message is "+e.getMessage());
			
		}
	}
	
}
